package com.jiaozi.core.table.entity;

import com.jiaozi.core.table.annotation.Column;
import com.jiaozi.core.table.enums.ColumnAlignEnum;
import com.jiaozi.core.table.enums.ColumnFixedEnum;
import com.jiaozi.core.table.enums.ColumnTypeEnum;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@AllArgsConstructor
@NoArgsConstructor
public class ZjColumn {
    //字段名称 对应列内容的字段名
    String prop;
    //显示的标题
    String label;
    //类型
    ColumnTypeEnum type;
    //对应列的宽度
    String width;
    //对应列的最小宽度
    String minWidth;
    //排序
    int order;
    //列是否固定在左侧或者右侧
    ColumnFixedEnum fixed;
    //对应列是否可以排序
    boolean sortable;
    //列对齐方式
    ColumnAlignEnum align;
    //是否展示
    boolean show;
    public ZjColumn(String prop, Column column){
        this.prop=prop;
        this.label=column.label();
        this.width=column.width();
        this.minWidth=column.minWidth();
        this.fixed=column.fixed();
        this.sortable=column.sortable();
        this.align=column.align();
        this.show=column.show();
        this.order=column.order();
        this.type=column.type();
    }
}
